<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>通讯录</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${s.base}/phone/css/common.css">
<link rel="stylesheet" href="${s.base}/phone/css/font-awesome.css">
<script src="${s.base}/js/jquery-3.2.0.min.js"></script>
</head>
<body>
<div class="content">
<div class="seach">
	<input type="search" autocomplete="off" name="baike-search" value="${search}" id="search" placeholder="请输入姓名/手机号" />
	<input type="hidden" id="url" value="${s.base}/mobile/mailList/${type}?personType=${personType}&id=${id}"/>
	<i class="fa fa-search"></i>

</div>
	<div class="AT-menu">
		<#if personType=="1" || personType=="3">
			<a href="JavaScript:void(0)" class="thick-line">老师通讯录</a>
		</#if>
		<#if personType=="2">
			<a href="${s.base}/mobile/mailList/3?personType=2&id=${id}" <#if type=="3" >class="thick-line"</#if>>家长通讯录</a> <a href="${s.base}/mobile/mailList/2?personType=2&id=${id}" <#if type=="2" >class="thick-line"</#if>>教师通讯录</a>
		</#if>



	</div>
	<div class="ATbox">
		<#if personType=="1" || personType=="3">
			<!--学生-->
			<#if type=="2">
				<#if personType=="1">
					<h3 class="Collapsing current">${msgStudent.gradeName}${msgStudent.className}<i class="fa fa-angle-down"></i></h3>
				</#if>
				<#if personType=="3">
					<h3 class="Collapsing current">${msgParent.gradeName}${msgParent.className}<i class="fa fa-angle-down"></i></h3>
				</#if>
				<!--代课教师信息展示-->
					<div class="coll_body">
						<#list msgTeacherList as msg>
							<div class="coll_block">
								<#if msg.headImgUrl??>
									<img src="${msg.headImgUrl}" />
									<#else>
										<img src="${s.base}/phone/images/wgz.jpg" />
								</#if>
								<div class="coll_block-right">
									<h3>${msg.teacherName}(<#if msg.type=="1">班主任</#if><#if msg.type=="2">任课老师</#if><#if msg.courseName??>-${msg.courseName}</#if>)</h3>
									<span>${msg.teacherPhone!"未录入"}</span>
								</div>
								<#if msg.teacherPhone??>
									<a href="tel:${msg.teacherPhone}" class="iconSize"><i  class="coll_block_icoG fa fa-phone "></i></a>
									<a href="sms:${msg.teacherPhone}" class="iconSize"><i  class="coll_block_ico fa fa-commenting-o "></i></a>
									<#else>
										<a href="javaScript:void(0)" class="iconSize"><i  class="coll_block_icoG fa fa-phone "></i></a>
										<a href="javaScript:void(0)" class="iconSize"><i  class="coll_block_ico fa fa-commenting-o "></i></a>
								</#if>
							</div>
						</#list>
					</div>
			</#if>
		</#if>

		<#if personType=="2">
			<!--教师-->
			<#if type=="2">
				<!--教师信息展示-->
				<#list orgInfoList as orgInfo>
                    <h3 class="Collapsing current">${orgInfo.orgName}
                        <#if orgInfo_index==0>
                                <i class="fa fa-angle-down"></i>
                            <#else>
                                <i class="fa fa-angle-right"></i>
                        </#if>

                    </h3>

					<div class="coll_body">
						<#list orgInfo.orgUserInfoList as orgUserInfo>
							<div class="coll_block">
								<img src="${s.base}/phone/images/bg.jpg" />
								<div class="coll_block-right">
									<h3>${orgUserInfo.userName}</h3>
									<span>${msg.phone!"未录入"}</span>
								</div>
                                <#if msg.phone$??>
                                    <a href="tel:${msg.phone$}" class="iconSize"><i  class="coll_block_icoG fa fa-phone "></i></a>
                                    <a href="sms:${msg.phone$}" class="iconSize"><i  class="coll_block_ico fa fa-commenting-o "></i></a>
                                    <#else>
                                        <a href="javaScript:void(0)" class="iconSize"><i  class="coll_block_icoG fa fa-phone "></i></a>
                                        <a href="javaScript:void(0)" class="iconSize"><i  class="coll_block_ico fa fa-commenting-o "></i></a>
                                </#if>
							</div>
						</#list>
					</div>
				</#list>
			</#if>
			<#if type=="3">
				<!--家长信息展示-->
				<#list msgTeacherClassList as msgTeacherClass>
					<h3 class="Collapsing current">${msgTeacherClass.gradeName}${msgTeacherClass.className}
                        <#if msgTeacherClass_index==0>
                            <i class="fa fa-angle-down"></i>
                            <#else>
                                <i class="fa fa-angle-right"></i>
                        </#if>
                    </h3>
					<div class="coll_body">
						<#list msgTeacherClass.msgParentList as msgParent>

							<div class="coll_block">
								<#if msgParent.headImgUrl??>
									<img src="${msgParent.headImgUrl}" />
									<#else>
										<img src="${s.base}/phone/images/wgz.jpg" />
								</#if>

								<div class="coll_block-right">
									<h3>${msgParent.parentName!"未录入"}(${msgParent.studentName})</h3>
									<span>${msgParent.parentPhone!"无"}</span>
								</div>
								<#if msgParent.parentName?? && msgParent.parentPhone??>
								<a href="tel:${msgParent.parentPhone}" class="iconSize"><i  class="coll_block_icoG fa fa-phone "></i></a>
								<a href="sms:${msgParent.parentPhone}" class="iconSize"><i  class="coll_block_ico fa fa-commenting-o "></i></a>
									<#else>
										<a href="javaScript:void(0)" class="iconSize"><i  class="coll_block_icoG fa fa-phone "></i></a>
										<a href="javaScript:void(0)" class="iconSize"><i  class="coll_block_ico fa fa-commenting-o "></i></a>
								</#if>
							</div>
						</#list>
					</div>
				</#list>
			</#if>
		</#if>


	</div>
	<script type="text/javascript">
	$(function(){
		$(".coll_body").eq(0).show();
		$(".Collapsing").bind("click",function(){
            if($(this).find("i").attr("class").indexOf("fa-angle-down") != -1){
                $(this).find("i").attr("class","fa fa-angle-right");
            }else{
                $("h3 i").attr("class","fa fa-angle-right");
                $(this).find("i").attr("class","fa fa-angle-down");
            }
			$(this).next(".coll_body").slideToggle(500).siblings(".coll_body").slideUp(500);
		});
		$("#search").bind("change",function(){
		    var search=$("#search").val();
		    if(search!=null && ""!=search){
                window.location.href=$("#url").val()+"&search="+encodeURI(search);
			}else{
                window.location.href=$("#url").val();
			}
		});
		
	});
	</script>
</div>
</body>
</html>
